<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of CustomerLinkman
 *
 * @author 志鹏
 */
class CustomerLinkmanAction extends CommonAction {
    
    
    public function _before_insert() {
        $_POST["dateline"] = CTS;
    }
    
    public function _after_insert() {
        $this->redirect("/CRM/Customer/viewDetail/id/".$_POST["customer_id"]);
    }
    public function _after_update() {
        $this->redirect("/CRM/Customer/viewDetail/id/".$_POST["customer_id"]);
    }
    
    public function ajax_getLinkman() {
        $id = abs(intval($_GET["customer_id"]));
        $customerLinkman = D("CustomerLinkman");
        $data = $customerLinkman->where("customer_id=".$id)->select();
//        print_r($data);
        $this->ajaxReturn($data);
    }
    
}
